#ifndef __DB_CONFIG_H__
#define __DB_CONFIG_H__

#include <string>
#include <vector>
#include <exception>
#include "DBConfig.h"

/**
 * @file IDBSession.h
 *
 * @brief Database interface
 *
 * @author cygia.com
 * Contact: lance.liao@cygia.com
 *
 */
class IDBSession {
public:
	virtual int Connect(CDBConfig config) = 0;
	virtual int Close() = 0;
	virtual int IsConnected() = 0;

	virtual int GetTables(std::vector<std::string>& tables) = 0;

	virtual int BeginTransaction() = 0;
	virtual int CommitTransaction() = 0;
	virtual int RollBackTransaction() = 0;

	virtual int ExecuteScalar(std::string sql, std::string& result) = 0;
	virtual int ExcuteSelect(std::string sql, std::vector<std::string>& results, int& col, int& row) = 0;
	virtual int ExcuteNonQuery(std::string sql) = 0;
};

#endif // !__DB_CONFIG_H__